<?php
namespace app\patient\controller;

use think\response\Json;
use app\AppAuthController;

class Index extends AppAuthController
{
    /**
     * @Notes: 上传图片
     * @Interface patient
     * @return Json
     * @author: Shaco
     * @Time: 2022/8/23-21:32
     */
    public function uploadImg(): Json
    {
        $fileArr = request()->file("file"); //接收文件
        $file = $_FILES['file']; //得到传输的数据
        $saveName = img($fileArr,$file);
        $data["name"] = $file["name"];
        $data["url"] = '/'.$saveName;

        return rejson(200,'操作成功', $data);
    }
}
